<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="PanierSyllatheque"></jsp:include>
<jsp:include page="header.jsp"></jsp:include>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
<div class="votrePanier">
    <div class="listePanier">
        <ul style="list-style-type: none;">
            <li><span class="imagePanier"><img src="tp/images/prix.png" width="32" alt="" /></span>
                <span class="textPanier"><fmt:message key="titlePanier" /></span></li>
            <li><a href="catalogue.jsp"><fmt:message key="infoVotrePanier" /></a></li>
        </ul>
    </div>

    <h2><fmt:message key="titlePanier" /></h2>

    <p><fmt:message key="introPanierDescr" /></p>
    <p><strong><fmt:message key="infoNbElementFirst" /> <span class="inscription">${nbElementPanier} <fmt:message key="nbElement" /></span> <fmt:message key="infoNbElementLast" /></strong></p>

    <div class="blockPrixPanier">
        <span class="prixPanier">
            <fmt:message key="prixTotal" /> : ${montantTotal} €
        </span>

        <div class="btnPanier">
            <form action="RecapPanierSyllatheque" method="post">
                <input type="submit" class="btn primary" <c:if test="${nbElementPanier == 0}">disabled="disabled" </c:if>value="<fmt:message key="btnClot" />" />
            </form>
        </div>
    </div>
</div>

<hr />

<div style="margin: 15px 15px">
    <c:if test="${not empty monNouveauSyllabus}"><span class="inscription"><fmt:message key="okAdd" /> ${monNouveauSyllabus}</span></c:if>
    <c:if test="${not empty modifSyllabus}"><span class="inscription"><fmt:message key="okModify" /> ${modifSyllabus}</span></c:if>
    <c:if test="${not empty deleteSyllabus}"><span class="inscription"><fmt:message key="okDelete" /> ${deleteSyllabus}</span></c:if>
    <c:if test="${not empty cloturer}">
        <span class="inscription"><fmt:message key="okCloturePasIdentifier" /></span>
    </c:if>
    <c:if test="${not empty erreurPanier}"><br /><span class="msgError"><fmt:message key="noDisplay" /></span></c:if>
    
    <table style="margin-top: 25px;">
        <tr>
            <th><fmt:message key="nSyll" /></th>
            <th><fmt:message key="pSyll" /></th>
            <th><fmt:message key="nbPage" /></th>
            <th><fmt:message key="quantity" /></th>
            <th><fmt:message key="del" /></th>
        </tr>
        <c:if test="${nbElementPanier != 0}">
            <c:forEach var="c" items="${hash}" >
                <tr>
                    <td><a href="VenteSyllatheque?id=${c.syllabus.syllabusId}">${c.syllabus.libelle}</a></td>
                    <td>${c.prix} €</td>
                    <td>${c.syllabus.nbPage}</td>
                    <td>
                        <form action="ModifierPanierSyllatheque" method="post" onsubmit="return validerFormPanier()" name="formModif">
                            <input type="number" name="quantite" value="${c.quantite}" style="width: 45px;" /> 
                            <input type="hidden" name="syllabusId" value="${c.syllabus.syllabusId}" />
                            <input type="hidden" name="compoId" value="${c.compoId}" />
                            <input type="submit" class="btn" value="<fmt:message key="modif" />" />
                        </form>
                    </td>
                    <td>
                        <form action="ModifierPanierSyllatheque" method="post" onsubmit="return validerFormSuppr()" name="formSuppr">
                            <input type="hidden" name="quantite" value="0" /> 
                            <input type="hidden" name="syllabusId" value="${c.syllabus.syllabusId}" />
                            <input type="hidden" name="compoId" value="${c.compoId}" /> 
                            <input type="submit" class="btn" name="supprimer" value="x" />
                        </form>
                    </td>
                </tr>
            </c:forEach>
        </c:if>
    </table>
</div>
        
<script type="text/javascript" src="tp/js/function.js"></script>

<jsp:include page="footer.jsp"></jsp:include>